;bs.hotkeys = function(key, callback, dom){

    var deferred = when.defer();
    if(window.hotkeys){
        __bind(key, callback, deferred, dom);
    }else{
       var d = bs.using.base + 'hotkeys/0.7.9/';
       var m = {
            js:d + 'jquery.hotkeys.min.js'
       };
       bs.using.modules.hotkeys = m;
       bs.using.load('hotkeys',function(){
           __bind(key, callback, deferred, dom);
       });
    }

   function __bind(key, callback, deferred,dom){
       var me = this;
       var _document = $(document);
       if(typeof dom !='undefined' && bs.util.isObject(dom)){
           _document = dom;
       }
       _document.bind('keydown', key,function(){
           deferred.resolve(hotkeys);
           if (bs.util.isFunction(callback)) {
               callback.call(me, hotkeys);
           }
       });


   };
   return deferred.promise;
}
